import layoutHeaderAside from '@/layout/header-aside'

// 由于懒加载页面太多的话会造成webpack热更新太慢，所以开发环境不使用懒加载，只有生产环境使用懒加载
const _import = require('@/libs/util.import.' + process.env.NODE_ENV)

const meta = { auth: true }

export default {
    path: '/restaurant/tempReport',
    name: 'tempReport',
    meta,
    redirect: { name: 'tempReport' },
    component: layoutHeaderAside,
    children: (pre => [
        {
            path: 'currentMonthRevenue',
            name: `${pre}currentMonthRevenue`,
            component: _import('restaurant/tempReport/currentMonthRevenue'),
            meta: {
                ...meta,
                title: '当月营收报表'
            }
        }
        ,{
            path: 'everydayRevenue',
            name: `${pre}everydayRevenue`,
            component: _import('restaurant/tempReport/everydayRevenue'),
            meta: {
                ...meta,
                title: '每日营收报表'
              }
        }
        ,{
            path: 'productSaleVolume',
            name: `${pre}productSaleVolume`,
            component: _import('restaurant/tempReport/productSaleVolume'),
            meta: {
                ...meta,
                title: '菜品销量报表'
              }
        },{
            path: 'productCategorySaleVolume',
            name: `${pre}productCategorySaleVolume`,
            component: _import('restaurant/tempReport/productCategorySaleVolume'),
            meta: {
                ...meta,
                title: '菜品分类报表'
              }
        },{
            path: 'shopOrderList',
            name: `${pre}shopOrderList`,
            component: _import('restaurant/tempReport/shopOrderList'),
            meta: {
                ...meta,
                title: '店铺订单明细'
              }
        },{
            path: 'shopOrderDetail',
            name: `${pre}shopOrderDetail`,
            component: _import('restaurant/tempReport/shopOrderDetail'),
            meta: {
                ...meta,
                title: '订单详情'
              }
        },{
            path: 'productStatisticsData',
            name: `${pre}productStatisticsData`,
            component: _import('restaurant/tempReport/productStatisticsData'),
            meta: {
                ...meta,
                title: '菜品统计报表'
              }
        },{
            path: 'orderDetailData',
            name: `${pre}orderDetailData`,
            component: _import('restaurant/tempReport/orderDetailData'),
            meta: {
                ...meta,
                title: '订单明细报表'
              }
        }
    ])('tempReport-')
}
